import tkinter as tk
from tkinter import messagebox
# 定义窗口
window = tk.Tk()
window.title('c语言中文网')
window.geometry('300x300')
window.iconbitmap('d:/logs/favicon.ico')
# 定义回调函数
def callback():
    messagebox.showwarning("信息","欢迎下次光临！")
# 点击执行按钮
button = tk.Button(window, text="执行", command=callback)
button.pack()
window.mainloop()